home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / util / cli / gengui21.lha / Gengui2.1 / Examples / frame.gui < prev    next >
Text File  |  1995-10-12  |  5KB  |  210 lines

  1.  
  2.  
  3. #c_source
  4.  
  5. UWORD chip Tool1Data[] =
  6. {
  7. /* Plane 0 */
  8.     0x0000,0x0000,0x0000,0x0400,0x0000,0x0000,0x0000,0x0C00,
  9.     0x0000,0x0000,0x0000,0x0C00,0x0000,0x0000,0x0000,0x0C00,
  10.     0x0000,0x0000,0x0000,0x0C00,0x0000,0x0000,0x0000,0x0C00,
  11.     0x03F0,0x0FFF,0xE000,0x0C00,0x0208,0x3000,0x1C00,0x0C00,
  12.     0x0207,0xC000,0x0380,0x0C00,0x0200,0x0000,0x0060,0x0C00,
  13.     0x0200,0x0000,0x0010,0x0C00,0x0200,0x0000,0x0008,0x0C00,
  14.     0x0207,0xC000,0x1FC4,0x0C00,0x0208,0x2000,0x2032,0x0C00,
  15.     0x03F0,0x1800,0xC00D,0x0C00,0x0000,0x0603,0x0003,0x0C00,
  16.     0x0000,0x0202,0x0000,0x0C00,0x0000,0x0202,0x0000,0x0C00,
  17.     0x0000,0x0202,0x0000,0x0C00,0x0000,0x03FE,0x0000,0x0C00,
  18.     0x0000,0x0000,0x0000,0x0C00,0x7FFF,0xFFFF,0xFFFF,0xFC00,
  19. /* Plane 1 */
  20.     0xFFFF,0xFFFF,0xFFFF,0xF800,0xD555,0x5555,0x5555,0x5000,
  21.     0xD555,0x5555,0x5555,0x5000,0xD555,0x5555,0x5555,0x5000,
  22.     0xD555,0x5555,0x5555,0x5000,0xD555,0x5555,0x5555,0x5000,
  23.     0xD405,0x5000,0x1555,0x5000,0xD405,0x4000,0x0155,0x5000,
  24.     0xD400,0x0000,0x0055,0x5000,0xD400,0x0000,0x0015,0x5000,
  25.     0xD400,0x0000,0x0005,0x5000,0xD400,0x0000,0x0005,0x5000,
  26.     0xD400,0x0000,0x0001,0x5000,0xD405,0x4000,0x1541,0x5000,
  27.     0xD405,0x4000,0x1550,0x5000,0xD555,0x5000,0x5554,0x5000,
  28.     0xD555,0x5401,0x5555,0x5000,0xD555,0x5401,0x5555,0x5000,
  29.     0xD555,0x5401,0x5555,0x5000,0xD555,0x5401,0x5555,0x5000,
  30.     0xD555,0x5555,0x5555,0x5000,0x8000,0x0000,0x0000,0x0000,
  31. };
  32.  
  33. struct Image Tool1 =
  34. {
  35.     0, 0,         /* Upper left corner */
  36.     54, 22, 2,         /* Width, Height, Depth */
  37.     Tool1Data,      /* Image data */
  38.     0x0003, 0x0000,      /* PlanePick, PlaneOnOff */
  39.     NULL         /* Next image */
  40. };
  41.  
  42. UWORD chip Tool2Data[] =
  43. {
  44. /* Plane 0 */
  45.     0x0000,0x0000,0x0000,0x0400,0x0000,0x0000,0x0000,0x0C00,
  46.     0x0000,0x0000,0x0000,0x0C00,0x0000,0x0000,0x0000,0x0C00,
  47.     0x0000,0x0000,0x0000,0x0C00,0x0000,0x0000,0x0000,0x0C00,
  48.     0x03F0,0x0FFF,0xE000,0x0C00,0x03F8,0x3FFF,0xFC00,0x0C00,
  49.     0x03FF,0xFFFF,0xFF80,0x0C00,0x03FF,0xFFFF,0xFFE0,0x0C00,
  50.     0x03FF,0xFFFF,0xFFF0,0x0C00,0x03FF,0xFFFF,0xFFF8,0x0C00,
  51.     0x03FF,0xFFFF,0xFFFC,0x0C00,0x03F8,0x3FFF,0xE03E,0x0C00,
  52.     0x03F0,0x1FFF,0xC00F,0x0C00,0x0000,0x07FF,0x0003,0x0C00,
  53.     0x0000,0x03FE,0x0000,0x0C00,0x0000,0x03FE,0x0000,0x0C00,
  54.     0x0000,0x03FE,0x0000,0x0C00,0x0000,0x03FE,0x0000,0x0C00,
  55.     0x0000,0x0000,0x0000,0x0C00,0x7FFF,0xFFFF,0xFFFF,0xFC00,
  56. /* Plane 1 */
  57.     0xFFFF,0xFFFF,0xFFFF,0xF800,0xD555,0x5555,0x5555,0x5000,
  58.     0xD555,0x5555,0x5555,0x5000,0xD555,0x5555,0x5555,0x5000,
  59.     0xD555,0x5555,0x5555,0x5000,0xD555,0x5555,0x5555,0x5000,
  60.     0xD405,0x5000,0x1555,0x5000,0xD405,0x4000,0x0155,0x5000,
  61.     0xD400,0x0000,0x0055,0x5000,0xD400,0x0000,0x0015,0x5000,
  62.     0xD400,0x0000,0x0005,0x5000,0xD400,0x0000,0x0005,0x5000,
  63.     0xD400,0x0000,0x0001,0x5000,0xD405,0x4000,0x1541,0x5000,
  64.     0xD405,0x4000,0x1550,0x5000,0xD555,0x5000,0x5554,0x5000,
  65.     0xD555,0x5401,0x5555,0x5000,0xD555,0x5401,0x5555,0x5000,
  66.     0xD555,0x5401,0x5555,0x5000,0xD555,0x5401,0x5555,0x5000,
  67.     0xD555,0x5555,0x5555,0x5000,0x8000,0x0000,0x0000,0x0000,
  68. };
  69.  
  70. struct Image Tool2 =
  71. {
  72.     0, 0,         /* Upper left corner */
  73.     54, 22, 2,         /* Width, Height, Depth */
  74.     Tool2Data,      /* Image data */
  75.     0x0003, 0x0000,      /* PlanePick, PlaneOnOff */
  76.     NULL         /* Next image */
  77. };
  78.  
  79. #include "backfillhook.h"
  80.  
  81. struct Hook pat1={{0,0},HookFunc,0,COLOR(0,0)};
  82. struct Hook pat2={{0,0},HookFunc,0,COLOR(1,2)};
  83. struct Hook pat3={{0,0},HookFunc,0,COLOR(2,3)};
  84.  
  85. #define TestPro XFrame
  86.  
  87. int __stdargs disable(struct IntuiMessage * );
  88. int __stdargs stophook(struct IntuiMessage * );
  89.  
  90. #end_source
  91.  
  92. ProjectName XFrame
  93. HBox
  94.    backfill &pat1
  95.    xspace 10
  96.    yspace 10
  97.  
  98.    vbox
  99.  
  100.       hrel 2
  101.  
  102.       xspace 4
  103.       yspace 4
  104.  
  105.       frame raised
  106.       backfill &pat2
  107.  
  108.       button
  109.          text "Disable"
  110.          id 1
  111.          hook disable
  112.       end
  113.  
  114.       button
  115.          text "Enable"
  116.          id 2
  117.          hook disable
  118.       end
  119.  
  120.       button
  121.          text "003"
  122.          id 3
  123.       end
  124.  
  125.       button
  126.          text "004"
  127.          id 4
  128.       end
  129.  
  130.       hbox
  131.       end
  132.  
  133.       plaintext
  134.          stdline 2
  135.          text "Stop/Remove GUI\nfor 3 seconds :"
  136.          flags GG_VCentered
  137.       end
  138.  
  139.       button
  140.          text "Stop"
  141.          id 5
  142.          hook stophook
  143.       end
  144.  
  145.       button
  146.          text "Remove"
  147.          id 6
  148.          hook stophook
  149.       end
  150.    end
  151.  
  152.    bar
  153.  
  154.    vbox
  155.  
  156.       GfxButton
  157.          minvchar 2
  158.          image &Tool1
  159.          image &Tool2
  160.          flags GG_HCentered,GG_VCentered
  161.          activation GACT_RELVERIFY,GACT_TOGGLESELECT
  162.          id 7
  163.       end
  164.  
  165.       vbox
  166.          frame recessed
  167.          xspace 0
  168.          yspace 0
  169.  
  170.          plaintext
  171.             text "%C2This %C1is %Ia\n"
  172.             text "%i%U%c3Test"
  173.             flags GG_HCentered,GG_VCentered
  174.          end
  175.       end
  176.    end
  177. end
  178.  
  179.  
  180. #c_source
  181.  
  182. extern struct Window *win;
  183.  
  184. int __stdargs disable(struct IntuiMessage *msg )
  185. {
  186.    GG_SetGadgetAttrs(XFrame_Gadgets[XFrame_7],win,NULL,
  187.                      GA_Disabled,GetGadget(msg)->GadgetID==1,TAG_DONE);
  188.    return 1;
  189. }
  190.  
  191. int __stdargs stophook(struct IntuiMessage *msg )
  192. {
  193.  
  194.    if(GetGadget(msg)->GadgetID==5) {
  195.       GG_StopGui(&XFrame);
  196.       GG_ClearWindow(win);
  197.       Delay(50*3);
  198.       GG_RenderGui(win,&XFrame);
  199.    } else {
  200.       GG_FreeGui(&XFrame);
  201.       GG_ClearWindow(win);
  202.       Delay(50*3);
  203.       GG_RenderGui(win,&XFrame);
  204.    }
  205.    return 1;
  206. }
  207.  
  208.  
  209. #end_source
  210.